﻿@{
    ViewBag.Title = "ListCategory";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}

@section scripts
{
    <script type="text/javascript" src="~/Scripts/App/Admin/category_list.js"></script>
}

<div class="row">
    <div class="col-mod-12">
        <ul class="breadcrumb">
            <li><a href="index.html">Dashboard</a></li>
            <li><a href="~/Admin/ListCategory">Category</a></li>
            <li class="active">List Category</li>
        </ul>
        <div class="form-group hiddn-minibar pull-right">
            <input data-bind="value: SearchString, valueUpdate: 'afterkeyup', event: { keypress: $root.SendMsg }" class="form-control form-cascade-control nav-input-search" type="text" size="20" placeholder="Search Category">
            <span class="input-icon fui-search"></span>
        </div>
    </div>
</div>

<div id="editCategory" class="modal-custom">
    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-cascade" id="modal-div">
                <div class="panel-heading">
                    <h3 class="panel-title"><i class="fa fa-edit"></i> Edit Category
                        <span class="pull-right">
                            <a class="panel-close" href="#"><i class="fa fa-times"></i></a>
                        </span>
                    </h3>
                </div>
                <div class="panel-body ">
                    <div class="ro">
                        <div class="col-mol-md-offset-2">
                            <form data-bind="submit: $root.doEdit" class="form-horizontal cascde-forms" method="post" action="#" name="category_edit" id="category_edit">
                                <div class="form-group">
                                    <label class="col-lg-2 col-md-3 control-label">Name</label>
                                    <div class="col-lg-10 col-md-9">
                                        <input type="text" class="form-control form-cascade-control input-small" name="Name" id="CategoryName" data-bind="value: Name">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-lg-2 col-md-3 control-label">Description</label>
                                    <div class="col-lg-10 col-md-9">
                                        <textarea style="resize: none" rows="5" class="form-control form-cascade-control input-small" name="Description" id="Description" data-bind="value: Description"></textarea>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-sm-offset-2 col-lg-10 col-md-9">
                                        <input type="submit" value="Submit" class="btn bg-primary text-white btn-lg">
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>
</div>

<div class="row">
    <div class="col-md-12">
        <div class="panel">
            <div class="panel-heading text-primary">
                <h3 class="panel-title"><i class="fa fa-list"></i> List Category
                  <a class="pull-right btn-custom" href="~/Admin/AddCategory">New</a>
                </h3>

            </div>
            <div class="panel-body">
                <table class="table users-table table-condensed table-hover">
                    <thead>
                        <tr>
                            <th class="visible-lg col-md-1">#</th>
                            <th class="visible-lg col-md-1">Icon</th>
                            <th class="visible-lg col-md-2">Category Name</th>
                            <th class="visible-lg col-md-6">Description</th>
                            <th>&nbsp;</th>
                        </tr>
                    </thead>
                    <tbody data-bind="foreach: Categories">
                        <tr>
                            <td data-bind="text: CatId" class="visible-lg col-md-1"></td>
                            <td class="visible-lg col-md-1">
                                <img width="32" height="32" src="D:\ASP.NET\Project\AOS-SourceCode\Advertising.Client.UI\App_Data\Category\order.png" />
                                @*<img width="32" height="32" data-bind="attr: { src: IconPath }" />*@
                            </td>
                            <td data-bind="text: Name" class="visible-lg col-md-2"></td>
                            <td data-bind="text: Description" class="visible-lg col-md-6"></td>
                            <td>
                                <button class="btn btn-warning" type="button" data-bind="click: $root.getEditItem"><i class="fa fa-edit"></i></button>
                                <button class="btn btn-danger" type="button" data-bind="click: $root.doDelete"><i class="fa fa-trash-o"></i></button>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
